package com.krain.ddbb.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by 胡亚敏 on 2016/3/21.
 */
public class PayCharge implements Parcelable {

    private String id;
    private String object;
    private long created;
    private boolean livemode;
    private boolean paid;
    private boolean refunded;
    private String app;
    private String channel;
    private String order_no;
    private String client_ip;
    private int amount;
    private int amount_settle;
    private String currency;
    private String subject;
    private String body;
    private String time_paid;
    private long time_expire;
    private long time_settle;
    private String transaction_no;
    private Refunds refunds;
    private int amount_refunded;
    private int failure_code;
    private String failure_msg;
    private MetaData metadata;
    private String description;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getObject() {
        return object;
    }

    public void setObject(String object) {
        this.object = object;
    }

    public long getCreated() {
        return created;
    }

    public void setCreated(long created) {
        this.created = created;
    }

    public boolean isLivemode() {
        return livemode;
    }

    public void setLivemode(boolean livemode) {
        this.livemode = livemode;
    }

    public boolean isPaid() {
        return paid;
    }

    public void setPaid(boolean paid) {
        this.paid = paid;
    }

    public boolean isRefunded() {
        return refunded;
    }

    public void setRefunded(boolean refunded) {
        this.refunded = refunded;
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getOrder_no() {
        return order_no;
    }

    public void setOrder_no(String order_no) {
        this.order_no = order_no;
    }

    public String getClient_ip() {
        return client_ip;
    }

    public void setClient_ip(String client_ip) {
        this.client_ip = client_ip;
    }

    public int getAmount() {
        return amount;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

    public int getAmount_settle() {
        return amount_settle;
    }

    public void setAmount_settle(int amount_settle) {
        this.amount_settle = amount_settle;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getTime_paid() {
        return time_paid;
    }

    public void setTime_paid(String time_paid) {
        this.time_paid = time_paid;
    }

    public long getTime_expire() {
        return time_expire;
    }

    public void setTime_expire(long time_expire) {
        this.time_expire = time_expire;
    }

    public long getTime_settle() {
        return time_settle;
    }

    public void setTime_settle(long time_settle) {
        this.time_settle = time_settle;
    }

    public String getTransaction_no() {
        return transaction_no;
    }

    public void setTransaction_no(String transaction_no) {
        this.transaction_no = transaction_no;
    }

    public Refunds getRefunds() {
        return refunds;
    }

    public void setRefunds(Refunds refunds) {
        this.refunds = refunds;
    }

    public int getAmount_refunded() {
        return amount_refunded;
    }

    public void setAmount_refunded(int amount_refunded) {
        this.amount_refunded = amount_refunded;
    }

    public int getFailure_code() {
        return failure_code;
    }

    public void setFailure_code(int failure_code) {
        this.failure_code = failure_code;
    }

    public String getFailure_msg() {
        return failure_msg;
    }

    public void setFailure_msg(String failure_msg) {
        this.failure_msg = failure_msg;
    }

    public MetaData getMetadata() {
        return metadata;
    }

    public void setMetadata(MetaData metadata) {
        this.metadata = metadata;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.object);
        dest.writeLong(this.created);
        dest.writeByte(livemode ? (byte) 1 : (byte) 0);
        dest.writeByte(paid ? (byte) 1 : (byte) 0);
        dest.writeByte(refunded ? (byte) 1 : (byte) 0);
        dest.writeString(this.app);
        dest.writeString(this.channel);
        dest.writeString(this.order_no);
        dest.writeString(this.client_ip);
        dest.writeInt(this.amount);
        dest.writeInt(this.amount_settle);
        dest.writeString(this.currency);
        dest.writeString(this.subject);
        dest.writeString(this.body);
        dest.writeString(this.time_paid);
        dest.writeLong(this.time_expire);
        dest.writeLong(this.time_settle);
        dest.writeString(this.transaction_no);
        dest.writeParcelable(this.refunds, 0);
        dest.writeInt(this.amount_refunded);
        dest.writeInt(this.failure_code);
        dest.writeString(this.failure_msg);
        dest.writeParcelable(this.metadata, flags);
        dest.writeString(this.description);
    }

    public PayCharge() {
    }

    protected PayCharge(Parcel in) {
        this.id = in.readString();
        this.object = in.readString();
        this.created = in.readLong();
        this.livemode = in.readByte() != 0;
        this.paid = in.readByte() != 0;
        this.refunded = in.readByte() != 0;
        this.app = in.readString();
        this.channel = in.readString();
        this.order_no = in.readString();
        this.client_ip = in.readString();
        this.amount = in.readInt();
        this.amount_settle = in.readInt();
        this.currency = in.readString();
        this.subject = in.readString();
        this.body = in.readString();
        this.time_paid = in.readString();
        this.time_expire = in.readLong();
        this.time_settle = in.readLong();
        this.transaction_no = in.readString();
        this.refunds = in.readParcelable(Refunds.class.getClassLoader());
        this.amount_refunded = in.readInt();
        this.failure_code = in.readInt();
        this.failure_msg = in.readString();
        this.metadata = in.readParcelable(MetaData.class.getClassLoader());
        this.description = in.readString();
    }

    public static final Parcelable.Creator<PayCharge> CREATOR = new Parcelable.Creator<PayCharge>() {
        public PayCharge createFromParcel(Parcel source) {
            return new PayCharge(source);
        }

        public PayCharge[] newArray(int size) {
            return new PayCharge[size];
        }
    };
}
